package com.chcit.share.security;
/**
 * @author liuyang
 * @createDate 2019/04/08 13:21
 * @see com.chcit.common.security.token
 */

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 用于配置token的属性
 * 
 * @author: liuyang
 */
@Configuration
@ConfigurationProperties(prefix = "chcit.security")
public class SecurityProperties {

	/**
	 * token失效时间(分钟） 默认2小时
	 */
	private int tokenExpireTime = 2 * 60;

	/**
	 * 是否使用jwttoken jwt token将授权信息编码进token，不需要缓存token
	 */
	private boolean jwtToken = false;

	/**
	 * jwt密钥
	 */
	private String jwtSecret = "chcit-jwt-key";

	/**
	 * 验证码失效时间（分钟) 默认10分钟
	 */
	private int codeExpireTime = 10;
	/**
	 * 验证码长度 默认4位
	 */
	private int codeSize = 4;

	public int getTokenExpireTime() {
		return tokenExpireTime;
	}

	public void setTokenExpireTime(int tokenExpireTime) {
		this.tokenExpireTime = tokenExpireTime;
	}

	public boolean isJwtToken() {
		return jwtToken;
	}

	public void setJwtToken(boolean jwtToken) {
		this.jwtToken = jwtToken;
	}

	public String getJwtSecret() {
		return jwtSecret;
	}

	public void setJwtSecret(String jwtSecret) {
		this.jwtSecret = jwtSecret;
	}

	public int getCodeExpireTime() {
		return codeExpireTime;
	}

	public void setCodeExpireTime(int codeExpireTime) {
		this.codeExpireTime = codeExpireTime;
	}

	public int getCodeSize() {
		return codeSize;
	}

	public void setCodeSize(int codeSize) {
		this.codeSize = codeSize;
	}

}
